﻿#region

using System;
using System.Collections.Generic;
using HouseHoldBudget.Core.Entities.Incomes;
using HouseHoldBudget.Core.Entities.User;

#endregion

namespace HouseHoldBudget.Core.Entities.Budgets
{
    public class Budget : BaseEntity
    {
        #region Fields

        private ICollection<BudgetUser> _actors;
        private ICollection<BudgetCategory> _categories;

        #endregion

        public Budget()
        {
            BudgetTypeId = (int)BudgetTypes.Mensual;
        }

        #region Instance Properties

        /// <summary>
        ///   Gets or sets the budget actors.
        /// </summary>
        /// <value> The budget actors. </value>
        public virtual ICollection<BudgetUser> BudgetActors
        {
            get
            {
                return _actors ?? (_actors = new List<BudgetUser>());
            }
            protected set
            {
                _actors = value;
            }
        }

        /// <summary>
        ///   Gets or sets the budget categories.
        /// </summary>
        /// <value> The budget categories. </value>
        public virtual ICollection<BudgetCategory> BudgetCategories
        {
            get
            {
                return _categories ?? (_categories = new List<BudgetCategory>());
            }
            protected set
            {
                _categories = value;
            }
        }

        /// <summary>
        ///   Gets or sets the budget creation on.
        /// </summary>
        /// <value> The budget creation on. </value>
        public virtual DateTime BudgetCreatedOn { get; set; }

        /// <summary>
        ///   Gets or sets the budget description.
        /// </summary>
        /// <value> The budget description. </value>
        public virtual string BudgetDescription { get; set; }

        /// <summary>
        ///   Gets or sets the name of the budget.
        /// </summary>
        /// <value> The name of the budget. </value>
        public virtual string BudgetName { get; set; }

        /// <summary>
        ///   Gets or sets the budget owner.
        /// </summary>
        /// <value> The budget owner. </value>
        public virtual BudgetUser BudgetOwner { get; set; }

        /// <summary>
        ///   Gets or sets the budget owner id.
        /// </summary>
        /// <value> The budget owner id. </value>
        public virtual Guid? BudgetOwnerId { get; set; }

        /// <summary>
        ///   Gets or sets the budget updated on.
        /// </summary>
        /// <value> The budget updated on. </value>
        public virtual DateTime? BudgetUpdatedOn { get; set; }

        /// <summary>
        /// Gets or sets the type of the budget.
        /// </summary>
        /// <value>
        /// The type of the budget.
        /// </value>
        public virtual int BudgetTypeId { get; set; }

        #endregion
    }
}